Skip to content

Better spans for #[filter_fn]#655

Merged
GuillaumeGomez merged 1 commit intoaskama-rs:mainfrom
Kijewski:pr-filter_fn-spans
Dec 30, 2025
Merged

Better spans for #[filter_fn]#655
GuillaumeGomez merged 1 commit intoaskama-rs:mainfrom
Kijewski:pr-filter_fn-spans

Conversation

@Kijewski
Copy link
Copy Markdown
Member

@Kijewski Kijewski commented Dec 30, 2025

This way any offending lines in the function signature or body are highlighted instead of the #[filter_fn] attribute.

Remove the line #[cfg(any())] to test the output.

This way any offending lines in the function signature or body are
highlighted instead of the `#[filter_fn]` attribute.

// Checks that `clippy::elidable_lifetime_names` is not triggered.
/// Checks that `clippy::unnecessary_wraps` is not triggered.
#[cfg(any())] // FIXME: <https://github.com/askama-rs/askama/issues/651>

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note test

Suspicious comment
@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

That's such a weird trick. ^^'

Thanks a lot!

@GuillaumeGomez GuillaumeGomez merged commit b99291e into askama-rs:main Dec 30, 2025
51 checks passed
@Kijewski Kijewski deleted the pr-filter_fn-spans branch December 30, 2025 11:56
@Kijewski
Copy link
Copy Markdown
Member Author

I guess clippy looks at specific tokens in the declaration of function, and if they are generated, it guesses everything is generated? A speed-up thing?

@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

Yeah that's not great and seems very brittle. Might be worth opening an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants